<?php 
//更新统计任务分类缓存
$arrTypess = $db->fetch_all_assoc("select * from ".dbprefix."task_type");
foreach($arrTypess as $key=>$item){
	$task = $db->once_fetch_assoc("select count(taskid) from ".dbprefix."task where typeid='".$item['typeid']."'");
	$arrTypes['list'][] = array(
		'typeid'	=> $item['typeid'],
		'typename'	=> $item['typename'],
		'count_task'	=> $task['count(taskid)'],
	);
}

$taskNum = $db->once_fetch_assoc("select count(taskid) from ".dbprefix."task");
$arrTypes['count'] = $taskNum['count(taskid)'];

//生成缓存文件
fileWrite('task_types.php','data',$arrTypes);

qiMsg("更新成功！");